<!DOCTYPE html>
<html>
    <head>
        <title>lehe {% block title%}{% endblock %}</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- 新 Bootstrap 核心 CSS 文件 -->
        <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
        <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
        <script type="text/javascript" src="/static/jquery-3.6.0.min.js"></script>
        <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
        <script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
        {% block css%}{% endblock %}
    </head>
    <body>
        {% block body%}{% endblock %}
        <div id="top-navbar">
            <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
                <div class="container-fluid">
                    <a class="navbar-brand" href="#">
                        <!--<img class="" src="static/image/logo-transparency-60px.png" alt="logo" width="90%" height="90%">-->
                        <img class="rounded-circle img-thumbnail" src="/static/image/logo.jpg" alt="logo" width="55%" height="55%">
                    </a>
                    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#daohangcaidan" aria-controls="daohangcaidan" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
                    <div id="daohangcaidan" class="collapse navbar-collapse">
                        <ul class="navbar-nav">
                            <li class="nav-item">
                                <a class="nav-link" aria-current="page" target="fanyi" href="/">翻译</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link {% block isactive %}{% endblock %}" target="" href="/knowledge">知道</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
            {% block submenu %}{% endblock %}
        </div>
        <div class="tab-content">
        {% block html%}{% endblock %}
        </div>
<!-- 自定义的模态窗口 ajax调用后台执行时展现 begin-->
<div id="loading" style="text-align:center;background-color:rgba(0,0,0,0.7);display:none; position:fixed;width:100%;height:100%;z-index:199;box-sizing: border-box;top:0;left:0;">
    <div class="card" style="width:50%;display:inline-block;top:30%">
        <div class="card-header">
          <h5>提示：</h5>
        </div>
        <div class="card-body">
          <p class="card-text">程序正在运行，请耐心等待......</p>
        </div>
    </div>
</div>
<!-- 自定义的模态窗口 ajax调用后台执行时展现 end-->
<!-- bootstrap的模态窗口 begin-->
<div class="modal" tabindex="-1" id="alertmodal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">提示：</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body" id="alertmodalbody">
        <p>Modal body text goes here.</p>
      </div>
      <!--<div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">确定</button>
      </div>-->
    </div>
  </div>
</div>
<!--使用示例
   const myModalAlternative = new bootstrap.Modal('#alertmodal');
   const myModalEl = document.getElementById('alertmodal');
    /**
     * 校验url
     */
    function validationUrl(){
        _url = $("#urlsearch").val();
        if(_url==""){
            myModalEl.addEventListener('shown.bs.modal', event => {
                $("#alertmodalbody").html("<p>请输入url</p>");
            });
            myModalAlternative.show();
            return false;
        }
        if(!isUrl(_url)){
            myModalEl.addEventListener('shown.bs.modal', event => {
                $("#alertmodalbody").html("<p>url格式错误，请重新输入</p>");
            });
            myModalAlternative.show();
            return false;
        }
        return true;
    }
    -->
<!-- bootstrap的模态窗口 end  -->
        {% block javascript%}{% endblock %}
    </body>
</html>
